package com.demo.controller;

import com.demo.service.CustomBot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.telegram.telegrambots.meta.api.methods.send.SendMessage;

/**
 * @Description:
 */
@RequestMapping("/msg")
@RestController
public class MessageController {

  @Autowired
  private CustomBot customBot;

  @RequestMapping("/send")
  public Object sendMsg(String aa){
    SendMessage sendMessage = new SendMessage();
    sendMessage.setChatId("-4076591451");
    sendMessage.setText(aa);
    customBot.sendMsg(sendMessage);

//    customBot.execute(sendMessage);

    return "success";
  }
}

